home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / POV2MRY2.ZIP / POV2MRY.TXT < prev   
Encoding:
Text File  |  1995-01-06  |  18.1 KB  |  545 lines

  1.                                                         01/06/95
  2.  
  3.  
  4.                                   P O V 2 M R Y
  5.  
  6.                              Version 0.91 Public Beta
  7.  
  8.                        POVRAY 2.x to Moray 1.5x Converter
  9.  
  10.                             a "public domain program"
  11.  
  12.                                  by Thomas Baier
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                What makes POV2MRY
  22.  
  23.        POV2MRY converts scene files for POVRAY to MORAY's MDL- format.
  24.  
  25.  
  26.                                   Introduction
  27.  
  28.        POVRAY certainly belongs to the best raytracers and is freely
  29.        available. The voluminous script language makes the realization of
  30.        complex scenes with high image quality possible. Soon after the
  31.        release of POVRAY there were modelers available, which supported
  32.        graphical design of sceneries. Certainly one of the first modeler
  33.        is MORAY. For a lot of people it is one of the best POVRAY modeler.
  34.        Of course the high quality of MORAY involves some limitations. Not
  35.        all objects of POVRAY are supported and the abilities in design of
  36.        textures are sufficently only for elementary requirements. Soon
  37.        there was a request for a converter from POVRAY to MORAY which
  38.        would make the import of older, manually designed scenes possible.
  39.        Exactly at this point POV2MRY started. The program reads a POVRAY
  40.        scene file and converts it to the MDL format of MORAY . Of course the
  41.        converter has the same limitations as MORAY.
  42.  
  43.  
  44.                                 What do you need
  45.  
  46.        minimum 386 Compatibel PC
  47.        DOS 3.3 or higher
  48.        Windows 3.x or higher (Dos-Box)
  49.        OS/2 2.x or higher    (Dos-Box)
  50.  
  51.        POVRAY Ver 2.0/2.2    (optional)
  52.        MORAY Ver 1.50/1.53
  53.  
  54.        Copy the shipped files to a directory of your choice. Make sure
  55.        that the program DOS4GW.EXE is available via the PATH variable.
  56.        The DOS Extender is needed by POV2MRY and MORAY. Please use the
  57.        version 1.95 or up.
  58.  
  59.  
  60.                             Files produced by POV2MRY
  61.  
  62.        POV2MRY generates a MDL file, which can be read by MORAY.
  63.        Additionally a LOG file will be generated which contains warnings
  64.        that might be issued during conversion. If you use textures via
  65.        declare, all used textures are written to a ANC - File. ANC means
  66.        Additional iNClude - File.
  67.  
  68.  
  69.                                  Running POV2MRY
  70.  
  71.        POV2MRY expects a filename as parameter in the commandline. The
  72.        file should be a POVRAY scene file in ASCII format.
  73.  
  74.        e.g.
  75.  
  76.               POV2MRY colors.pov
  77.  
  78.  
  79.        After successful read (syntax errors abort conversion) the MDL
  80.        file will have been generated in the same directory (e.g.
  81.        colors.mdl). The ANC - File will be generated (e.g. colors.anc).
  82.        Additionally a LOG file (e.g. colors.log) will exist which
  83.        contains possibly issued warnings.
  84.  
  85.  
  86.                               set - variable POV_INC
  87.  
  88.        The set - variable "POV_INC" contains additional searchpathes
  89.        for used include files. This feature behaves exactly the same way
  90.        as with POVRAY:
  91.  
  92.               set pov_inc=c:\povray;d:\moray\scenes
  93.  
  94.        If an include file is not found reading will be aborted.
  95.  
  96.  
  97.                                 What is supported
  98.  
  99.        First of all not every object known to POVRAY or MORAY is supported.
  100.  
  101.        Supported Objects:
  102.  
  103.          Box
  104.          Sphere
  105.          Cylinder
  106.          Light_source
  107.          CSG
  108.          Heightfield
  109.          Bicubic_Patch
  110.          Torus
  111.          Plane
  112.          Disc
  113.          Object
  114.          Texture
  115.          Default
  116.          Camera
  117.  
  118.  
  119.        Camera:
  120.        Location, Look_at and the length of the direction vector is
  121.        used.
  122.  
  123.        A big problem is parallelity of the location and sky vector. Both
  124.        programs have the prob. The error appears with the message
  125.        "abnormal program termination" and is a floating point error
  126.        (during calculation of a normal vector). If you have the source
  127.        of both programs it is easy to avoid this message. But I do not
  128.        and instead the message "Warning: Look_at/Location vector
  129.        parallel to Moray sky vector in xxx !" will be issued and a
  130.        little value (0.001) will be added to the x-component of the
  131.        location vector. If somebody has a better idea, please call me.
  132.  
  133.        Another problem results from the different default values for the
  134.        camera definition. MORAY defines the up and sky vector fixed with
  135.        <0,0,1>. POVRAY does it per default with <0,1,0>. MORAY defines
  136.        the z-axis as height, POVRAY defines the y-axis as height.
  137.  
  138.        e.g.:
  139.  
  140.        camera
  141.        {
  142.           location <10,10,10>
  143.           look_at <0,0,0>
  144.        }
  145.  
  146.  
  147.        MORAY defines the camera in this way (after export):
  148.  
  149.        camera
  150.        {
  151.                 location  <1.000, -8.000, 5.000>
  152.                 direction <0.0,     0.0,  0.6667>
  153.          ???--->sky       <0.0,     0.0,  1.0>  // Use right handed-system!
  154.          ???--->up        <0.0,     0.0,  1.0>  // Where Z is up
  155.                 right     <1.3333,  0.0,  0.0>
  156.                 look_at   <0.000, 0.000, 1.000>
  157.        }
  158.  
  159.        A scene file for POVRAY with default up and sky vectors looks a bit
  160.        strange after conversion, reexport to POVRAY and rendering.
  161.        The image is mirrored horizotally and vertically. The camera view in
  162.        MORAY gives the same view. The converter will issue a message
  163.        like:  "Sky-Vector is different form Moray's camera settings in
  164.        Object xxx !"
  165.  
  166.  
  167.        In this case the best solution is to modify the wrong vectors.
  168.  
  169.        e.g.:
  170.  
  171.        camera
  172.        {
  173.                 location  <1.000, -8.000, 5.000>
  174.                 direction <0.0,     0.0,  0.6667>
  175.          !!!--->sky       <0.0,     1.0,  0.0>  // Use right handed-system!
  176.          !!!--->up        <0.0,     1.0,  0.0>  // Where Z is up
  177.                 right     <1.3333,  0.0,  0.0>
  178.                 look_at   <0.000, 0.000, 1.000>
  179.        }
  180.  
  181.        In the next release i will have a better solution.
  182.  
  183.  
  184.        Texture:
  185.        Normal modifications are ignored because they are not supported
  186.        by MORAY. Pigment and finish modifications are supported as fas
  187.        as MORAY does.
  188.  
  189.        Additional the ANC - file is created, which contains all used
  190.        texture - declares. After exporting the scene you can add this
  191.        file as include - file.
  192.  
  193.        e.g.:
  194.  
  195.               #declare my_texture = texture { color GREEN }
  196.  
  197.               box { <0,0,0>,<1,1,1> texture {my_teyxture}}
  198.  
  199.        Pigment and finish identifiers will be expanded. The names won't
  200.        be imported but the single parameters will be converted.
  201.  
  202.         e.g.:
  203.  
  204.               box {
  205.                  <0,0,0>,<1,1,1>
  206.                  texture {
  207.                     pigment { redmarble }
  208.                     finish  { mirror }
  209.                  }
  210.               }
  211.  
  212.        The "default" texture statement will be evaluated. The feature
  213.        works the same as it does with POVRAY. If "default" is defined
  214.        every object without a texture will have this texture.
  215.  
  216.        Bounding and clipping is not supported.
  217.  
  218.        The object "cone" is not convertable, because MORAY does not
  219.        support the second radius.
  220.  
  221.        The parser supports only POVRAY 2.0 syntax. POVRAY 1.0 syntax is
  222.        not supported. The exact syntax is described in POVRAY.DOC.
  223.  
  224.        The keyword "version" is totally ignored.
  225.  
  226.        All other objects and features of POVRAY are ignored.
  227.  
  228.        If there is an object that is not convertable by POV2MRY, a short
  229.        message will be written to the LOG - file.
  230.  
  231.  
  232.                                    Converting
  233.  
  234.        The transformations are a special theme for converting. The
  235.        syntax of POVRAY accepts transformations (scale, rotate and
  236.        translate) at several locations and in several orders. MORAY on
  237.        the other side accepts only object and texture transformationes
  238.        and only in a strict order (scale, rotate and then translate).
  239.        This leads to some strangs effects after conversion.
  240.  
  241.        The surprise appears if a scale <a,b,c> follows a rotation. The
  242.        conversion to the sequence scale, rotate, translate can not be
  243.        made complete. The result in MORAY will not be what you expected.
  244.        An additional shear vector would be helpful but is not yet
  245.        implemented in POVRAY or MORAY. If POV2MRY recognizes such a
  246.        construct the message "Warning: Inaccurate Matrix Operation
  247.        (Shear Vector) in Object xxx !" will be written to the LOG file.
  248.        The problem does not appear when the scaling vector is of the
  249.        form <a,a,a> (equal to 'scale a').
  250.  
  251.        Implicite transformations and avoiding shear vectors:
  252.  
  253.        object structure of POVRAY:
  254.  
  255.        OBJECT
  256.        {
  257.               FACE-PARAMETER
  258.               FACE-TRANSFORMATIONS
  259.               texture
  260.               {
  261.                      TEXTURE-PARAMETERS
  262.                      TEXTURE_TRANSFORMATIONS
  263.               }
  264.               OBJECT_TRANSFORMATIONS
  265.        }
  266.  
  267.        object structure of MORAY:
  268.  
  269.        OBJECT
  270.        {
  271.               FIX-FACE-PARAMETER
  272.               texture
  273.               {
  274.                      TEXTURE-PARAMETERS
  275.                      TEXTURE-TRANSFORMATIONS
  276.               }
  277.               OBJECT-TRANSFORMATIONS
  278.        }
  279.  
  280.        FACE - PARAMETER:
  281.        Moray supports only fix parameters (e.g. box { <-1,-1,-1>,
  282.        <1,1,1> }). At this point an implicite transformation could
  283.        happen. Fortunately this problem can be avoided moving the
  284.        implicite transformations to real transformations. The fix
  285.        parameters of every object supported by MORAY can be seen by
  286.        creating an object in MORAY and exporting it directly.
  287.  
  288.        FACE-TRANSFORMATIONS:
  289.        This kind of transformation is not known by MORAY.
  290.  
  291.        To avoid the collection of FACE - TRANSFORMATIONs, OBJECT -
  292.        TRANSFORMATIONs and TEXTURE - TRANSFORMATIONs the general object
  293.        structure of POVRAY will be divided as follows:
  294.  
  295.         union
  296.         {
  297.                 union
  298.                 {
  299.                         OBJECT
  300.                         {
  301.                                 FACE-PARAMETER
  302.                         }
  303.                         FACE-TRANSFORMATIONS
  304.                 }
  305.                 texture
  306.                 {
  307.                         TEXTURE-PARAMETERS
  308.                         TEXTURE-TRANSFORMATIONS
  309.                 }
  310.                 OBJECT-TRANSFORMATIONS
  311.         }
  312.  
  313.         e.g.:
  314.  
  315.         scenery file for POVRAY:
  316.  
  317.            ...
  318.            box
  319.            {
  320.                    <0,0,0>,<2,2,2>
  321.                    rotate <30,0,0>
  322.                    texture {my_texture}
  323.                    scale 4
  324.                    translate <3,2,1>
  325.            }
  326.            ...
  327.  
  328.        After converting, importing to MORAY and exporting to POVRAY
  329.        this becomes:
  330.  
  331.            ...
  332.            #declare ##box0 = box {
  333.               <-1, -1, -1>, <1, 1, 1>
  334.               translate <1.000000, 1.000000, 1.000000>
  335.            }
  336.  
  337.            #declare #box0 = union {
  338.               object { ##box0 }
  339.               rotate <30.000000, 0.000000, 0.000000>
  340.            }
  341.  
  342.            union {
  343.               object { #box0 }
  344.               texture {
  345.                  my_texture
  346.                  ...
  347.               }
  348.               scale <4.000000, 4.000000, 4.000000>
  349.               translate <3.000000, 2.000000, 1.000000>
  350.            }
  351.  
  352.  
  353.  
  354.        After evaluating all declare's:
  355.  
  356.         union
  357.         {
  358.                 union
  359.                 {
  360.                         box
  361.                         {
  362.                                 <-1,-1,-1>,<1,1,1>
  363.                                 translate <1.000000, 1.000000, 1.000000>
  364.                         }
  365.                         rotate <30.000000, 0.000000, 0.000000>
  366.  
  367.                 }
  368.                 texture
  369.                 {
  370.                         my_texture
  371.                         ...
  372.                 }
  373.                 scale <4.000000, 4.000000, 4.000000>
  374.                 translate <3.000000, 2.000000, 1.000000>
  375.         }
  376.  
  377.        In this release now i use the trick to avoid all shear
  378.        operations.
  379.  
  380.        e.g.
  381.  
  382.            ...
  383.            box
  384.            {
  385.                    <0,0,0>,<2,2,2>
  386.                    texture {my_texture}
  387.                    rotate <90,80,70>
  388.                    scale <4,3,2>
  389.                    translate <3,2,1>
  390.  
  391.            }
  392.            ...
  393.  
  394.        The converter translates the object in to following structure:
  395.  
  396.            object
  397.            {
  398.                     box
  399.                     {
  400.                         <0,0,0>,<2,2,2>
  401.                         texture {my_texture}
  402.                         rotate <90,80,70>
  403.                     }
  404.                     scale <4,3,2>
  405.                     translate <3,2,1>
  406.            }
  407.  
  408.  
  409.                                 Some hints
  410.  
  411.        If you have probs converting a scene try to render the scene with
  412.        POVRAY. If POVRAY has probs, the chances are not too bad that
  413.        POV2MRY will have either.
  414.  
  415.        If you have probs with memory try this:
  416.  
  417.        put this 10 lines in to a file named new4g.vmc ...
  418.  
  419.        !.VMC file DOS4GW.EXE
  420.        !This file shows the parameter values.
  421.        minmem = 1024           At least 1024K bytes of RAM is required.
  422.        maxmem = 8192           Uses no more than 8MB of phys. RAM
  423.        !virtualsize = 32768     Swap file plus allocated memory is 32MB
  424.        virtualsize = 16384      Swap file plus allocated memory is 16MB
  425.        !To delete the swap file automatically when the program exits, add
  426.        deleteswap
  427.        !To store the swap file in a directory called SWAPFILE, add
  428.        !swapname = c:\swapfile\dos4gvm.swp
  429.  
  430.        and write on the dos - command - line:
  431.  
  432.        set dos4gvw=@new4g.vmc   [RETURN]
  433.  
  434.        This is from the DOS4GW - documentation and will increase the
  435.        virtual memory for DOS4GW.
  436.  
  437.  
  438.  
  439.                                For Techies
  440.  
  441.        POV2MRY is entirely written in C++. The parser was developed with
  442.        Lex&Yacc, a class library manages all POVRAY objects. The parser
  443.        engine is absolutely independent from the MORAY modul and could
  444.        be used for a wide variety of tasks.
  445.        For example the POVRAY syntax could be easily enlarged by some
  446.        elements for animation. Nevertheless the output can be pure
  447.        POVRAY code.
  448.  
  449.        Every converter from POVRAY to XXX is conceivable ..., but makes
  450.        no sense, because I am not aware of other modelers or raytracers
  451.        that follow the rules and have the features POVRAY has (exept
  452.        VIVID and/or POLYRAY).
  453.  
  454.        All known modelers for POVRAY are very strict in using
  455.        transformations. The work for a converter is very hard, and I am
  456.        not sure it is worth it. The converter could not support all
  457.        features of POVRAY.
  458.  
  459.  
  460.                                      Thanks to
  461.  
  462.        Bernhard Baier
  463.        Lutz Kretzschmar         (Moray)
  464.        Erkki Sondergaard        (POV-Team)
  465.        Lex van der Sluijs       (GUM)
  466.        Andreas Lagotzki         (RR)
  467.  
  468.                                    The future
  469.  
  470.        The next project will be a pure POVRAY texture parser. I would
  471.        publish this engine for free use. Such an engine would make
  472.        texture editors be able to import POVRAY textures.
  473.  
  474.        Further I have a POVRAY to DXF converter in mind. First ideas are
  475.        in my drawer.
  476.  
  477.  
  478.                          If you find a strange situation
  479.  
  480.        If you have a scenery or object that is not convertable in the
  481.        right way, or you find a bug or some strange behaviour, please
  482.        send me a letter or e-mail with the scenery file and an error
  483.        description.
  484.  
  485.        Thanks.
  486.  
  487.  
  488.                                  Use of POV2MRY
  489.  
  490.        You are welcome to make copies of this program and pass them on
  491.        to friends or post this program on bulletin boards or distribute
  492.        it via disk catalog services provided the entire distribution is
  493.        included in its original, unmodified form. A distribution fee may
  494.        be charged for the cost of the diskette, shipping and handling.
  495.        However, POV2MRY may not be sold, or incorporated in another
  496.        product that is sold, without the permission of Thomas Baier.
  497.  
  498.        You are welcome to contact the author:
  499.  
  500.                                   Thomas Baier
  501.                                  Ammerseestr. 9
  502.                                  85551 Kirchheim
  503.                                      Germany
  504.                              FidoNet: 2:2480/843.24
  505.                            RenderRing: 511:3000/333.24
  506.                               PCG-Net: 9:526/327.24
  507.  
  508.        Both the POV2MRY program and documentation are copyright (c) 1994
  509.        by Thomas Baier. You are not authorized to modify the program.
  510.        "POV2MRY" is a trademark.
  511.  
  512.                                    Disclaimer
  513.  
  514.        POV2MRY is provided "as is" without warranty of any kind, either
  515.        expressed or implied. This program may contain "bugs" and
  516.        inaccuracies, and its results should not be assumed to be correct
  517.        unless they are verified by independent means. The author assumes
  518.        no responsibility for the use of POV2MRY and will not be
  519.        responsible for any damage resulting from its use.
  520.  
  521.  
  522.                                    Trademarks
  523.  
  524.        OS/2 is a trademark of IBM
  525.        Windows is a trademark of Microsoft
  526.        DOS is a trademark of Microsoft
  527.        Povray is a trademark of the POV-Team
  528.        Moray is a trademark of SoftTronics
  529.  
  530.  
  531.                                  History
  532.  
  533.        Version 0.91
  534.        - problem with pigment in textures.inc solved
  535.        - if pigment contains nonsupported items, no texture is written
  536.        - parser optimized
  537.        - additional ANC - file is written. It contains all used textures
  538.        - problem with composite solved
  539.        - avoiding all shear operation within a object definition
  540.        - heightfields now correct imported
  541.  
  542.        Version 0.9
  543.        - first release
  544.  
  545.